// 模块化的使用

const state = {
  str: '张三'
}
const mutations = {
  SET_STR(state, params) {
    state.str = params
  }
}
const actions = {
  getStr({ commit }, params) {
    commit('SET_STR', params)
  }
}
const getters = {
  newStr(state) {
    return (state.str = '王八')
  }
}

export default {
  state,
  mutations,
  actions,
  getters
}
